package com.z.admin.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author z
 * @since 2022-03-13
 */
@TableName("t_danmu")
@ApiModel(value="弹幕对象", description="")
public class Danmu implements Serializable {

    private static final long serialVersionUID = -2912274141949513382L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 弹幕文本内容
     */
    @TableField("text")
    private String text;
    /**
     * 弹幕颜色
     */
    @TableField("color")
    private String color;
    /**
     * 弹幕位置 0为滚动 1 为顶部 2为底部
     */
    @TableField("position")
    private String position;
    /**
     * 弹幕文字大小
     */
    @TableField("size")
    private String size;
    /**
     * time——弹幕所出现的时间。 单位为分秒（十分之一秒）
     */
    private Integer time;
    /**
     * 用户ID
     */
    @TableField("user_id")
    private Long userId;
    /**
     * 视频ID
     */
    @TableField("post_id")
    private Long postId;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh", timezone = "GMT+8")
    @TableField("create_time")
    private Date createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh", timezone = "GMT+8")
    @TableField("update_time")
    private Date updateTime;

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    public String getSize() {
        return size;
    }

    public void setSize(String size) {
        this.size = size;
    }

    public Integer getTime() {
        return time;
    }

    public void setTime(Integer time) {
        this.time = time;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getPostId() {
        return postId;
    }

    public void setPostId(Long postId) {
        this.postId = postId;
    }

    @Override
    public String toString() {
        return "'{" +
                "text:\"" + text + '\"' +
                ", color:\"" + color + '\"' +
                ", position:" + position +
                ", size:" + size  +
                ", time:" + time +
                ", userId:" + userId +
                ", postId:" + postId +
                "}'";
    }

    public String string() {
        return "{" +
                "text:" + '"' + text + '"' +
                ", color:" + '"' + color + '"' +
                ", position:" + position +
                ", size:" + size  +
                ", time:" + time +
                ", userId:" + userId +
                ", postId:" + postId +
                "}";
    }
}
